
import Vue from 'vue'
import { navdata } from './config';
import {mapState,mapMutations,mapGetters,mapActions} from 'vuex'
import { reg } from './validate';

Vue.mixin({
    data(){
        return {
            navdata,
            reg
        }
    },
    computed:{
        // 引入所有的Vuex 数据
        ...mapState([
            'cartNum',
            'userInfo',
            'city',
            'cityList',
            'allCinemas'
        ]),
        ...mapGetters(['hotcity'])
    },
    methods:{
        ...mapMutations([
            'changeUserInfo',
            'changeCity',
            'changeCityList',
            'changeAllCinemas'
        ]),
        ...mapActions([
            'getCinemasAsync'
        ]),
        gotoWhere(options){
            this.$router.push(options)
        },
        gotoback(){
            this.$router.back()
        },
        showErrMsg(message='失败'){
            this.$notify({
                message: message,
                color: '#ad0000',
                background: '#ffe1e1',
            });
        }

    },
    mounted(){
        // console.log("I am Mixins")
    }
})